<?php

use yii\helpers\Html;
use yii\widgets\DetailView;
use  backend\helpers\ActionButton;
use yii\grid\GridView;

/* @var $this yii\web\View */
/* @var $model backend\models\ArchiveSection */

$this->title = $model->name;
$this->params['breadcrumbs'][] = ['label' => 'Архив', 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => 'Разделы', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="container archive-section-view">

    <h1 class="main-title"><?= Html::encode($this->title) ?></h1>

    <p>
        <?= ActionButton::update($model->id, 'updateArchiveSection') ?>
        <?= ActionButton::delete($model->id, 'Вы уверены, что хотите удалить этот раздел?', 'deleteArchiveSection') ?>
    </p>



<?= GridView::widget([
        'dataProvider' => $itemsDataProvider,
        //'filterModel' => $itemsSearchModel,
        'tableOptions' => [
            'class' => 'table table-striped'
        ],
        'layout' => '{items}{pager}{summary}',
        'columns' => [
            // [
            //     'attribute'=>'m_number',
            //     'contentOptions' => ['style' => 'width:110px;'],
            // ],
            [
                'attribute'=>'title',
                'contentOptions' => ['style' => 'white-space: normal;'],
            ],
            
            // [
            //     'attribute'=>'is_Digitized',
            //     'filter'=>SimpleFlagHelper::StatusList(),
            //     'value' => function ($model) {
            //         return SimpleFlagHelper::statusLabel($model->is_Digitized);
            //     },
            //     'format' => 'raw',
            //     'contentOptions' => ['style' => 'width:100px;'],
            // ],
            //'description:ntext',

            [
                'class' => 'yii\grid\ActionColumn',
                'controller' => 'archive-item',
                'visibleButtons' =>
                [
                    'view' => Yii::$app->user->can('browseArchiveItem'),
                    'update' => Yii::$app->user->can('updateArchiveItem'),
                    'delete' => Yii::$app->user->can('deleteArchiveItem'),
                ]
            ],
        ],
    ]); ?>

</div>
